package tech.anzhen.simple.rpc.test.client;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import tech.anzhen.simple.rpc.support.RemoteServiceProxyFactoryBean;
import tech.anzhen.simple.rpc.support.api.TestRpcService;

/**
 * @author: Anzhen
 **/
@Configuration
public class RpcConfig {

    @Bean
    public TestRpcService testRpcService() {
        RemoteServiceProxyFactoryBean<TestRpcService> factoryBean = new RemoteServiceProxyFactoryBean<>();
        factoryBean.setSystemName("testRpcService");
        factoryBean.setConnectTimeout(10000);
        factoryBean.setReadTimeout(10000);
        factoryBean.setServiceInterface(TestRpcService.class);
        return factoryBean.getObject();
    }
}
